import { request } from 'umi';
const PROJECT_NAME = process.env.PROJECT_NAME;
// import { any } from '@/services/commonSelect/orgSelectService';
// import { any } from '@/services/commonSelect/userSelectService';

/**
 * 富文本复制的图片上传至自己服务器
 */
export async function uploadContentImg(data: any) {
  return request(`/${PROJECT_NAME}/uploadContent/img`, { method: 'POST', data });
}

/**
 * 获取字典数组
 * @param param
 */
export async function getSysDictListByTypeCodeNew(data: any) {
  return request(`/${PROJECT_NAME}/sys/sysDict/getSysDictListByTypeCodeNew`, {
    method: 'POST',
    data,
  });
}

/**
 * 地区选择三级联动
 * @param param
 */
export async function getAreaListByPid(data: any) {
  return request(`/${PROJECT_NAME}/sys/sysArea/getAreaListByPid`, { method: 'POST', data });
}

/**
 * 地区选择三级联动,根据末级查询完整树,传入末级id
 * @param param
 */
export async function getAreaTree(data: any) {
  return request(`/${PROJECT_NAME}/sys/sysArea/getAreaInfoByPid`, { method: 'POST', data });
}
// 获取学校id和简称
export async function getSchoolList(data: any) {
  return request(`/${PROJECT_NAME}/school/findSchoolIdAndNameList`, {
    method: 'POST',
    data
  });
}

// 根据学校id获取院系id和简称
export async function getDepartmentList(data: any) {
  return request(`/${PROJECT_NAME}/school/findDeptIdAndNameListBySchoolId`, {
    method: 'POST',
    data,
  });
}

//根据院系id获取专业id和简称
export async function findMajorIdAndNameListByDeptId(data: any) {
  return request(`/${PROJECT_NAME}/school/findMajorIdAndNameListByDeptId`, {
    method: 'POST',
    data,
  });
}
// 根据学校id查询所有专业
export async function majorListTree(data: any) {
  return request(`/${PROJECT_NAME}/school/listDeptMajorTree`, { method: 'POST', data });
}

/**
 * 选人组件
 */
 export function getMajorIdByTeacherId(data: any) {
  return request(`/${PROJECT_NAME}/task/taskEnterprise/getMajorIdByTeacherId`, { method: 'POST', data });
}

export function getStudentByMajorId(data: any) {
  return request(`/${PROJECT_NAME}/task/taskEnterprise/getStudentByMajorId`, { method: 'POST', data });
}
